﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;

namespace Marmat.FrameWork
{

    /// <summary>
    /// 默认的注册扩展支持。
    /// </summary>
    public static class StartupExtension
    {
        /// <summary>
        /// 设置自定义的登录窗体
        /// </summary>
        /// <typeparam name="TForm"></typeparam>
        /// <param name="services"></param>
        public static void AddCustomLoginForm<TForm>(this IServiceCollection services) where TForm : class, Marmat.Foundation.ILoginForm
        {
            services.AddTransient<Marmat.Foundation.ILoginForm, TForm>();
        }

        /// <summary>
        /// 设置自定义的主窗体
        /// </summary>
        /// <param name="services"></param>
        public static void AddCustomMainForm<TForm>(this IServiceCollection services) where TForm : class, Marmat.Foundation.IMainForm
        {
            services.AddScoped<Marmat.Foundation.IMainForm, TForm>();
        }
    }
}
